package functions;

import main.ContingencyTable;

public class GoodmanKruskalFunction extends GeneralFunction {

	public GoodmanKruskalFunction(String name) {
		super(name);
	}

	@Override
	public double calculate(ContingencyTable t) {
		return (((Math.max(t.f00(), t.f01()) - Math.max(t.fp0(), t.fp1())) + (Math
				.max(t.f10(), t.f11()) - Math.max(t.fp0(), t.fp1())))
				/ (t.N() - Math.max(t.fp0(), t.fp1()))) / -t.N();
	}

}
